<!doctype html>
<html xmlns="http://www.w3.org/1999/html">
<head>
<meta charset="utf-8">
<title>留言管理</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" href="weixin_statics/css/reset.css">
<link rel="stylesheet" href="weixin_statics/css/style.css">
    <script src="weixin_statics/js/jquery-1.7.2.min.js" type="text/javascript"></script>
</head>
<style>.hidden{display:none;}</style>
<body>
	<div class="top-bar">
    	<div class="top-logo"><a href="index.html"><img src="weixin_statics/images/home.png" alt="">返回首页</a></div>
        <div class="top-prev"><a href="javascript:history.go(-1)"><img src="weixin_statics/images/arrow_left.png" alt="">返回上一页</a></div>
    </div>
    <div class="warp">
        <form action="__URL__/add_mess" method="post" onSubmit="return check();">
            留言内容：<input name="content" type="text" /><span id="content" class="hidden"><font color="red">留言内容不能为空</font></span><br/>
            
            <eq name="tid" value="1">
                手机号码：<input name="from" type="text" /><span id="from" class="hidden"><font color="red">请填写正确格式手机号</font></span>
                <else/>
                <input name="from" value="{$truename}" type="hidden" />
            </eq><br/>
            <input type="hidden" name="cid" value="{$Think.get.cid}" />
            <input type="submit" name="submit" value="提交留言" />
        </form>
        <volist name="mess.data" id="m">
    	<h4 class="com-title">{$m.content}</h4>
        <h5 class="s-title">提问人：{$m.fr}   发表时间：{$info.ctime|date="Y-m-d H:i",###}</h5> 
        回复：<volist name="m.reply" id="r" empty="暂无回复">
        <p>{$r.content} 回复时间：{$r.ctime|date="Y-m-d H:i",###}</p>
        </volist>
        <hr/>
        </volist>
        <div class="cop-show">
            <img src="{$info.pic.url}" alt="">
            {$info.intro}<br />
        </div>
    </div>
</body>
</html>
<script >
function check(){
    if($("input[name='content']").attr('value')==""){
        $("#content").removeClass('hidden');
        return false;
    }else{
        $("#content").addClass('hidden');
    }
    var tid = "{$tid}";
    if(tid == 1){
        var num = $("input[name='from']").attr('value');
        if(num == ""){
            $("#from").removeClass('hidden');
            return false;
        }else{
            if(num.match(/^1[3|4|5|8][0-9]\d{4,8}$/)){
                $("#from").addClass('hidden');
            }else{
                $("#from").removeClass('hidden');
                return false;
            }  
        }
     
    } 
}
</script>
